package com.kuqi.controller;

import com.kuqi.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

/**
 * @author:kuqi
 * @createTime:2021/10/18 19:51
 * @description:
 */

public class AccountController {
    public static void main(String[] args) {
        /*获取Spring容器*/
        ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
        //创建Service对象，由Spring容器帮我们创建
        AccountService accountService = (AccountService) app.getBean("accountService");
        //调用其方法
        accountService.transfer("tom","lucy",500);
    }
}
